package com.lily.user.application;


import com.lily.user.api.UserDomainIApi;
import org.springframework.web.bind.annotation.RestController;
import com.lily.user.domain.UserDM;
import com.lily.user.domain.UserDomainService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@RestController
public class UserDomainApi implements UserDomainIApi {

    @Autowired
    UserDomainService userDomainService;

    @Override
    public List<UserDM> getAll(UserDM userDM) {
        List<UserDM> userDMList = userDomainService.getAll(userDM);
        return userDMList;
    }

    @Override
    public UserDM add(UserDM userDM) {
        userDomainService.add(userDM);
        return userDM;
    }

    @Override
    public List<UserDM> page(UserDM userDM, Integer current, Integer size) {
        return userDomainService.page(userDM,current,size);
    }

    @Override
    public UserDM queryOne(UserDM userDM) {
        return userDomainService.queryOne(userDM);
    }

    @Override
    public UserDM update(UserDM userDM) {
        return userDomainService.update(userDM);
    }

    @Override
    public UserDM delete(UserDM userDM) {
        return userDomainService.delete(userDM);
    }
}
